package cn.wilson.hrm.feign.client;

import cn.wilson.hrm.doc.CourseDoc;
import cn.wilson.hrm.feign.fallback.EsFeignClientFallbackFactory;
import cn.wilson.hrm.query.CourseQuery;
import cn.wilson.hrm.utils.AjaxResult;
import cn.wilson.hrm.utils.PageList;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

//用来调用es服务feign的接口
@FeignClient(value = "es-server",fallbackFactory = EsFeignClientFallbackFactory.class)
public interface EsFeignClient {

    @RequestMapping("/es/save")
    AjaxResult save(@RequestBody CourseDoc courseDoc);

    @RequestMapping("/es/offline")
    AjaxResult offline(@RequestBody CourseDoc courseDoc);

    @RequestMapping("/es/searchCourse")
    PageList<CourseDoc> searchCourse(@RequestBody CourseQuery courseQuery);

}
